package com.itwn.comic.mapper;

import com.itwn.comic.entity.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role record);

    Role selectByPrimaryKey(Long id);

    List<Role> selectAll();

    int updateByPrimaryKey(Role record);

    List<Role> selectRoleByName(String name);

    void insertRoleAndMenu(@Param("id") Long id,@Param("list") List<Integer> list);

    @Delete("delete from t_role_permission where role_id = #{value}")
    void deleteByRoleID(Long id);
    
    List<Role> selectRoleByManager(int id);
}